package com.movitech.mobile.cz.base.purchase.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.movitech.mobile.cz.base.purchase.entity.WFlowFormCashDeposit;
import com.movitech.mobile.cz.base.purchase.entity.ext.ExtWFlowFormCashDeposit;
import com.movitech.mobile.cz.base.purchase.mapper.WFlowFormCashDepositMapper;
import com.movitech.mobile.cz.base.purchase.mapper.ext.ExtWFlowFormCashDepositMapper;
import com.movitech.mobile.cz.base.purchase.service.WFlowFormCashDepositService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 流程表单-供应商入围-保证金确认 服务实现类
 * </p>
 *
 * @author Movitech Mobile
 * @since 2018-03-15
 */
@Service
public class WFlowFormCashDepositServiceImpl extends ServiceImpl<WFlowFormCashDepositMapper, WFlowFormCashDeposit> implements WFlowFormCashDepositService {

	@Autowired
	private ExtWFlowFormCashDepositMapper extWFlowFormCashDepositMapper;
	
	/**
	 * 确认保证金列表初始化查询
	 */
	@Override
	public List<ExtWFlowFormCashDeposit> selectDepositConfirmBidCandidateUnitList(Map<String, Object> param) {
		return extWFlowFormCashDepositMapper.selectDepositConfirmBidCandidateUnitList(param);
	}

	@Override
	public List<ExtWFlowFormCashDeposit> getExtByFormId(String formId) {
		return extWFlowFormCashDepositMapper.getByFormId(formId);
	}

	@Override
	public void updateRefundStatus(String id, Integer status) {
		WFlowFormCashDeposit wFlowFormCashDeposit = new WFlowFormCashDeposit();
		wFlowFormCashDeposit.setId(id);
		wFlowFormCashDeposit.setRefundCashierStatus(status);
		updateById(wFlowFormCashDeposit);
	}

	/**
	 * 确认保证金列表查询接口
	 */
	@Override
	public List<ExtWFlowFormCashDeposit> selectDepositConfirmBidList(Map<String, Object> param) {
		return extWFlowFormCashDepositMapper.selectDepositConfirmBidList(param);
	}

	@Override
	public ExtWFlowFormCashDeposit getExtByFormIdAndSupplierId(String formId, String supplierId) {
		return extWFlowFormCashDepositMapper.getExtByFormIdAndSupplierId(formId, supplierId);
	}

}
